home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 125 / Computer Shopper CD-ROM Issue 125 (1998-07)(Dennis Publishing).iso / Business / Dazzler / DAZZLER.Z / CWidgit.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-26  |  881 b   |  52 lines

  1. import java.awt.Dimension;
  2. import java.awt.Graphics;
  3. import java.io.DataInputStream;
  4.  
  5. class CWidgit extends CIconObject {
  6.    protected CPicture m_Image = new CPicture();
  7.    protected int m_nImageCount;
  8.    private int m_nCurPos;
  9.  
  10.    CWidgit() {
  11.       this.m_Image.m_nFlags = 16384;
  12.       this.m_nImageCount = 1;
  13.    }
  14.  
  15.    void Draw(Graphics var1, CRect var2) {
  16.       if (this.m_Image != null) {
  17.          if (this.m_nImageCount > 1) {
  18.             this.m_Image.Draw(var1, var2, this.m_nCurPos, this.m_nImageCount);
  19.             return;
  20.          }
  21.  
  22.          this.m_Image.Draw(var1, var2);
  23.       }
  24.  
  25.    }
  26.  
  27.    boolean Increment() {
  28.       ++this.m_nCurPos;
  29.       if (this.m_nCurPos >= this.m_nImageCount) {
  30.          this.m_nCurPos = 0;
  31.       }
  32.  
  33.       return this.m_nCurPos == 0;
  34.    }
  35.  
  36.    Dimension Load() {
  37.       Dimension var1 = null;
  38.       if (this.m_Image != null) {
  39.          var1 = this.m_Image.LoadImage();
  40.          this.m_nCurPos = 0;
  41.       }
  42.  
  43.       return var1;
  44.    }
  45.  
  46.    boolean LoadFromFile(DataInputStream var1) {
  47.       this.m_Image.LoadFromFile(var1);
  48.       this.m_nImageCount = FileLoad.ReadCPlusInt(var1);
  49.       return true;
  50.    }
  51. }
  52.